package org.smile.validate.handler;

import org.smile.beans.BeanProperties;
import org.smile.util.ValidateUtils;
import org.smile.validate.Rule;
import org.smile.validate.ValidateSupport;
import org.smile.validate.ValidateText;

public class RequiredValidator extends Validator {

	@Override
	protected boolean validate(Rule f, ValidateSupport action,BeanProperties properties,Object value){
		boolean result=ValidateUtils.required(value);
		if(!result){
			error(action, f);
		}
		return result;
	}

	@Override
	public String defaultTxt() {
		return ValidateText.required;
	}
}
